unit HostPort;

interface

uses
  Database,
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TFormHostPort = class(TForm)
    Label1: TLabel;
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    EditHost: TEdit;
    Label2: TLabel;
    EditPort: TEdit;
    CheckCR: TCheckBox;
    EditTrigger: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    BtnMud: TBitBtn;
    procedure BtnCancelClick(Sender: TObject);
    procedure BtnOKClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure EditHostKeyPress(Sender: TObject; var Key: Char);
    procedure EditPortKeyPress(Sender: TObject; var Key: Char);
    procedure EditHostChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    linked: boolean;
  end;

var
  FormHostPort: TFormHostPort;

implementation

{$R *.DFM}

procedure TFormHostPort.FormCreate(Sender: TObject);
begin
  linked:=false;
end;

procedure TFormHostPort.BtnCancelClick(Sender: TObject);
begin
  close;
end;

procedure TFormHostPort.EditHostKeyPress(Sender: TObject;
  var Key: Char);
begin
  if key = #13 then begin
    EditPort.setfocus;
    key:=#0;
  end;
end;

procedure TFormHostPort.EditPortKeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then begin
    BtnOK.click;
    key:=#0;
  end;
end;

procedure TFormHostPort.BtnOKClick(Sender: TObject);
begin
  linked:=true;
  close;
end;

procedure TFormHostPort.EditHostChange(Sender: TObject);
begin
  BtnOK.enabled:=((EditHost.text <> '') and (EditPort.text <> ''));
end;

end.
